package com.cloud.code.算法.队列;

import com.cloud.code.算法.队列.循环队列.LoopQueue;
import com.cloud.code.算法.队列.数组队列.ArrayQuque;

public class Test {

    public static void main(String[] args) {
        Queue<String> arrayQueue = new ArrayQuque(1000);
        Queue<String> loopQueue = new LoopQueue<>(1000);

        extracted(arrayQueue);
        extracted(loopQueue);

    }

    private static void extracted(Queue<String> queue) {
        long start = System.nanoTime();
        for (int i = 0; i < 200000; i++) {

            queue.push(i + "test");

        }

        while (queue.getSize() > 0)
            queue.pop();

        System.out.println("used time :" + (System.nanoTime()/1000000000.0 - start/1000000000.0)  );
    }
}
